package com.carter.springframework.beans.factory.config;

import com.carter.springframework.beans.exception.BeanException;
import com.carter.springframework.beans.factory.BeanFactory;

public interface AutowireCapableBeanFactory extends BeanFactory {


    int AUTOWIRE_NO = 0;

    int AUTOWIRE_BY_NAME = 1;


    int AUTOWIRE_BY_TYPE = 2;

    int AUTOWIRE_CONSTRUCTOR = 3;


    @Deprecated
    int AUTOWIRE_AUTODETECT = 4;


    String ORIGINAL_INSTANCE_SUFFIX = ".ORIGINAL";
    /**
     * 执行BeanPostProcessors接口实现类的postProcessBeforeInitialization方法
     * @param existingBean
     * @param beanName
     * @return
     * @throws BeanException
     */
    Object applyBeanPostProcessorsBeforeInitialization(Class<?> existingBean, String beanName) throws BeanException;

    /**
     * 执行BeanPostProcessors接口实现类的postProcessorsAfterInitialization方法
     * @param existingBean
     * @param beanName
     * @return
     * @throws BeanException
     */
    Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName) throws BeanException;
}
